﻿#pragma once
#include <DisyEngine.hpp>
// 主窗口
class MainWindow final :
	public NAMESPACENAME::WindowForm
{
	// 页面
	NAMESPACENAME::Page* page;
	// 两个按钮
	NAMESPACENAME::Button* button, * displayButton;
	// 文本
	NAMESPACENAME::Label* label;
	// 富文本
	NAMESPACENAME::RichEdit* richEdit;
public:
	MainWindow();
	virtual ~MainWindow() = default;
	virtual void OnDestroy()override final
	{
		NAMESPACENAME::WindowForm::OnDestroy();
		PostQuitMessage(0);
	}
	static void ButtonClick(Control* sender, NAMESPACENAME::EventArgs& e)
	{
		dynamic_cast<NAMESPACENAME::Button*>(sender)->Visibility(Control::Visibility::Hidden);
	}
	static void LabelClick(Control* sender, NAMESPACENAME::EventArgs& e)
	{
		dynamic_cast<NAMESPACENAME::Label*>(sender)->Visibility(Control::Visibility::Hidden);
	}
	static void LeftButtonClick(Control* sender, NAMESPACENAME::EventArgs& e);
	/// <summary>
	/// 保存推出前的窗口位置和大小
	/// </summary>
	/// <param name="sender">消息发送者</param>
	/// <param name="e">消息参数</param>
	static void SaveWindowPositionAndSize(Control* sender, NAMESPACENAME::EventArgs& e);
};